home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-21 / qwhite.zip / KEYBCONF.TEC < prev    next >
Text File  |  1992-03-09  |  17KB  |  324 lines

  1. ID:KY DESQview and the Keyboard
  2. Quarterdeck Technical Bulletin #206
  3. by Quarterdeck Testing & Compatibility
  4. last revision:  7 February 1992
  5.  
  6.                            KEYBOARD CONFLICT
  7.  
  8.      The purpose of this document is to discuss how DESQview handles keyboard 
  9. input and how the "keyboard conflict" field of the DVP (Change-a-Program 
  10. screen) affects how keyboard input is handled in a window.
  11.  
  12. A TECHNICAL PERSPECTIVE
  13.  
  14.      This section explains the technical underpinnings of how the keyboard is 
  15. read by the computer and what DESQview does with keyboard input.  It is not 
  16. necessary to understand all these issues perfectly in order to use the 
  17. Keyboard Conflict setting, but it will help your understanding of what to do 
  18. if you do read the Technical Perspective.  Individual issues (DESQview scripts 
  19. and Mark & Transfer) and the meaning of each setting of Keyboard Conflict are 
  20. discussed in their own sections after the Technical Perspective.  Users 
  21. looking for the quickest possible solution to a problem can go directly to the 
  22. Summary at the end of this document, then back to the specific section to 
  23. which it refers to address their problem.
  24.  
  25. How does my keyboard communicate with my computer?
  26.  
  27.      Every computer has a keyboard controller chip, usually an 8042.  This 
  28. chip handles the interface between the keyboard and the motherboard.  There is 
  29. a 15 character buffer (41E-42D in the address space; this can be seen in the 
  30. First Meg/BIOS Data screen of Manifest).  When you press and release a key the 
  31. keyboard controller chip generates a scan code.  IRQ 1 is asserted and the 
  32. BIOS's (or whoever's) Interrupt 9 handler responds to this and, if the key 
  33. pressed is a character (a letter or number or punctuation mark) the 
  34. appropriate scan code and character is sent to the BIOS keyboard buffer.  If 
  35. the key pressed is a shift key (shift, capslock, numlock, scroll lock, alt, 
  36. ctrl) no key is put into the keyboard buffer: the "shift-state" byte is 
  37. changed instead.  The "shift-state" byte is byte 417 in the BIOS Data area; it 
  38. is the first byte of the line labeled "Keyboard Control" in the First Meg/BIOS 
  39. Data screen of Manifest. If you press ctrl-alt-del or ctrl-pause or print 
  40. screen or some other keystroke upon which DOS or the BIOS acts directly the 
  41. proper action (warm-boot or pause or print screen or whatever) is executed 
  42. without putting a scan code in the BIOS keyboard buffer. 
  43.      Your programs or operating system are constantly reading this buffer to 
  44. read keys out of it.  If you type in more keys than your application can read 
  45. and the keyboard buffer gets full then the next keystroke will be rejected and 
  46. you will hear a warning beep.  For us slow typists this only happens when some 
  47. application locks up the computer yet we continue to type.
  48.      The usual way a program gets keyboard input is to use BIOS Interrupt 16 
  49. to get the next character in the keyboard buffer.  Programs also may get 
  50. characters from the keyboard buffer directly. Programs may also handle 
  51. Interrupt 9 directly, taking keystrokes before they go into the keyboard 
  52. buffer and possibly not letting the keystroke go into the keyboard buffer at 
  53. all.
  54.  
  55.      There are two ways for a program to use Interrupt 16 to get a keystroke:  
  56. The first way is to wait for input; in this mode the program's operation is 
  57. suspended until a key is pressed.  The second way is to test for input; in 
  58. this mode the program sees if a key has been pressed and, if no key has been 
  59. pressed, continues its other processes and tests again later.  
  60.  
  61. How does DESQview handle keyboard input? 
  62.      
  63.      Each window is given its own 128 character keyboard buffer, much larger 
  64. than BIOS's 15 character buffer.  Overflowing this buffer is an unlikely 
  65. event. DESQview moves keys from the BIOS keyboard buffer to the keyboard 
  66. buffer of the foreground window. DESQview takes over keyboard servicing by 
  67. intercepting all invocations of interrupt 16 and sending the application that 
  68. calls for keyboard input from the BIOS keyboard buffer the character(s) in the 
  69. window's own keyboard buffer.  Only the foreground window is allowed to see 
  70. the keyboard.
  71.  
  72. What happens if my program reads the BIOS keyboard buffer directly?
  73.  
  74.      Applications that get their keyboard input by looking directly at the 
  75. BIOS keyboard buffer, not by invoking interrupt 16, have the potential problem 
  76. of grabbing keystrokes while they are in background that are meant for the 
  77. foreground window.  The cure for this problem is discussed in the explanation 
  78. of the Keyboard Conflict setting "4".
  79.  
  80. What happens if my program intercepts Interrupt 9 directly? 
  81.  
  82.      If an application intercepts Interrupt 9 to get keyboard input before it 
  83. goes to the BIOS keyboard buffer and it holds onto Interrupt 9 and does the 
  84. "wrong" things this window may need to have Keyboard Conflict set to "8".  See 
  85. the discussion of this setting of Keyboard Conflict.
  86.  
  87. DESQVIEW SCRIPTS
  88.  
  89.      DESQview's script feature allows a single keystroke (or combination such 
  90. as "control-T") to play back a sequence of learned keystrokes.  It does this 
  91. by moving the characters stored in the script file of the window associated 
  92. with the invoking keystroke into the DESQview "Playback" buffer. Problems 
  93. using DESQview scripts with some programs are addressed by setting keyboard 
  94. conflict to "1" or "2".  
  95.      Programs that need Keyboard Conflict set to 4 because they take 
  96. keystrokes directly out of the BIOS keyboard buffer, without using Int 16, 
  97. will not allow DESQview scripts to be learned or execute because the 
  98. keystrokes will not be seen by DESQview.
  99.      NOTE:  Some programs do not use the BIOS keyboard buffer (Microsoft's 
  100. "Windows" is one such); they intercept keystrokes before they go into the BIOS 
  101. keyboard buffer and ignore anything put into the BIOS keyboard buffer.  Such 
  102. programs will neither record nor execute DESQview scripts.
  103.  
  104. MARK AND TRANSFER
  105.  
  106.      The MARK feature of DESQview allows text (not graphics) to be read from 
  107. the screen and stored in DESQview's common memory.  TRANSFER moves this 
  108. information into the keyboard buffer of the destination window so the 
  109. TRANSFERred information is sent to the window as though it were entered from 
  110. the keyboard into the program.  Problems that some programs may have with 
  111. TRANSFER are addressed by setting keyboard conflict to "1" or "2".
  112.      Programs that need Keyboard Conflict set to 4 because they take
  113. keystrokes out of the BIOS keyboard buffer, without using Int 16, will not 
  114. allow MARK & TRANSFER to work because the keystrokes will never enter the BIOS 
  115. keyboard buffer.
  116.      NOTE:  Some programs do not use the BIOS keyboard buffer (Microsoft's 
  117. "Windows" is one such); they intercept keystrokes before they go into the BIOS 
  118. keyboard buffer and ignore anything put into the BIOS keyboard buffer.  Such 
  119. programs will not accept data TRANSFERred into them.
  120.  
  121. KEYBOARD CONFLICT = 1
  122.  
  123.      Some programs throw away "type-ahead."  These programs get keystrokes by 
  124. testing the keyboard buffer for input and throwing away keys that were entered 
  125. too quickly, presuming that they were entered by mistake or were the result of 
  126. holding down a "type-matic" key (a key that automatically repeats when held 
  127. down) too long, presumably mistakenly.  The program may wish to make sure that 
  128. a key is not entered carelessly at an important time ("Format disk (Y/N)?").  
  129. Because executing a script or a transfer puts keys into the keyboard buffer 
  130. very quickly programs that throw away type-ahead may think that the keys the 
  131. script or transfer puts in are type-ahead.  With keyboard conflict set to 1, 
  132. DESQview only responds affirmatively to the test for keyboard input every 
  133. sixth time during the execution of a script, making it appear as if keystrokes 
  134. are being entered at one-sixth the speed.  Though all the characters the 
  135. script or transfer puts into the buffer are read by the application, it thinks 
  136. that they are coming at a sixth of the actual speed.  If a script or transfer 
  137. is failing, especially by not completing, then keyboard conflict set to 1 
  138. should be tried.  This setting of keyboard conflict does not affect the 
  139. operation of the computer when a script or transfer is not executing.   
  140.  
  141. KEYBOARD CONFLICT = 2
  142.  
  143.      This setting of keyboard conflict causes DESQview never to respond 
  144. affirmatively to a program's testing for input when a script or transfer is 
  145. being executed.  If a program, when it gets no positive response to testing 
  146. for input, falls back to waiting for input, it will then read these 
  147. characters.  If it always only tests for input, then Keyboard Conflict = 2 
  148. will not work.  This setting is for programs even more prone to throw away 
  149. type-ahead.  Also a test for input is answered in the affirmative only every 
  150. sixth time even when a script or transfer is not being executed.
  151.   
  152. KEYBOARD CONFLICT = 3    
  153.  
  154.      This setting does the same thing as "2".
  155.  
  156. KEYBOARD CONFLICT = 4
  157.  
  158.      Some programs read the BIOS keyboard buffer directly rather than using 
  159. Interrupt 16.  Programs that do this may, while running in background, steal 
  160. keystrokes from the foreground program.  Keyboard Conflict = 4 keeps DESQview 
  161. from moving keystrokes from the BIOS keyboard buffer into the DESQview 
  162. keyboard buffer for this window and it keeps the program in this window from 
  163. getting its timer ticks at certain important moments when the foreground 
  164. program is likely to be processing keystrokes.  This should prevent keystrokes 
  165. from being stolen from the foreground window while this window is in 
  166. background.
  167.      If "Maintain separate shift states" (in the "DESQview Setup:  Keyboard") 
  168. is set to "y" then all windows for which Keyboard Conflict is set to 4 will 
  169. have a completely separate copy of the BIOS keyboard buffer saved and restored 
  170. for them, thus making the above precautions unnecessary (and thus not 
  171. performed) and assuring that this program will not steal keystrokes while it 
  172. is in background. 
  173.      Programs that need Keyboard Conflict set to 4 because they take 
  174. keystrokes out of the BIOS keyboard buffer, without using Int 16, will not 
  175. allow DESQview scripts or TRANSFERs to execute because the keystrokes will 
  176. never enter the BIOS keyboard buffer.  This may happen with any program that 
  177. requires a setting of 4, 5, 6, 7, or C and higher.
  178.      This setting may slow down the performance of your system very slightly.
  179.  
  180. KEYBOARD CONFLICT = 5
  181.  
  182.      This setting combines the effects of keyboard conflict = 4 with keyboard 
  183. conflict = 1.  Therefore if you are having problems with a program both 
  184. stealing keystrokes while it is in background and excuting scripts and 
  185. transfers, this is the setting to use.  If the program intercepts keystrokes 
  186. before they enter the BIOS keyboard buffer, as discussed above, then scripts 
  187. and transfers will not work anyway.
  188.  
  189. KEYBOARD CONFLICT = 6    
  190.  
  191.      This setting combines the effects of keyboard conflict = 4 with keyboard 
  192. conflict = 2.
  193.  
  194. KEYBOARD CONFLICT = 7
  195.  
  196.      This setting is the same as 6.
  197.  
  198. KEYBOARD CONFLICT = 8
  199.  
  200.      Some programs get their keyboard input even before it goes into the BIOS 
  201. keyboard buffer by handling Interrupt 9 directly.  They may do this because 
  202. they need to get keystrokes that do not send characters to the keyboard buffer 
  203. (such as the "alt", "ctrl", "numlock", "capslock", "scrolllock" keys) or for 
  204. any reason they choose.  In a multitasking environment like DESQview a program 
  205. running in the background gets its period of time to execute ("ticks") when it 
  206. is in the background but the foreground window maintains possession of the 
  207. keyboard.  If a program running in the background grabs Interrupt 9 and, this 
  208. program presuming that it is the only program running, does such things as 
  209. invoking other interrupts, then it may malfunction because the interrupts it 
  210. may invoke may be in the possession of another window (or DESQview).  Keyboard 
  211. conflict = 8 causes DESQview to save and restore a whole state of the Int 9 
  212. handler for programs loaded into windows every time they get their time-slice 
  213. with keyboard conflict set to 8.  This takes time and causes this window to 
  214. operate more slowly.  Candidates for this setting are some 3270 emulator 
  215. programs and it may help TSRs pop-up over a window more readily.
  216.      This setting will probably slow down the processing of keystrokes a 
  217. noticeable amount and may cause loss of keystrokes or inappropriate shift 
  218. states.
  219.  
  220. KEYBOARD CONFLICT = 9
  221.  
  222.      This setting combines the features of keyboard conflict = 8 with keyboard 
  223. conflict = 1.
  224.  
  225. KEYBOARD CONFLICT = A
  226.  
  227.      This setting combines the features of keyboard conflict=8 with keyboard 
  228. conflict=2.  A is hexadecimal for 10.
  229.  
  230. KEYBOARD CONFLICT = B
  231.  
  232.      This setting does the same thing as A.  B is hexadecimal for 11.
  233.  
  234. KEYBOARD CONFLICT = C
  235.  
  236.      This setting combines the features of keyboard conflict=8 with keyboard 
  237. conflict=4.  C is hexadecimal for 12.
  238.  
  239. KEYBOARD CONFLICT = D    
  240.  
  241.      This setting combines the features of keyboard conflict settings 8, 4, 
  242. and 1.  D is hexadecimal for 13.
  243.  
  244. KEYBOARD CONFLICT = E
  245.  
  246.      This setting combines the features of keyboard conflict settings 8, 4, 
  247. and 2.  E is hexadecimal for 14.
  248.  
  249. KEYBOARD CONFLICT = F
  250.  
  251.      This setting does the same thing as E.  F is hexadecimal for 15.
  252.  
  253. OTHER KEYBOARD CONSIDERATIONS
  254.  
  255. /OK
  256.  
  257.      This is a switch used when starting DESQview that tells DESQview to treat 
  258. your keyboard as an ordinary 84 key keyboard.  The BIOS on some computers does 
  259. not support the enhanced keyboard properly and some BIOSes report that they 
  260. have an enhanced keyboard when they do not; DESQview must be told to ignore 
  261. the "enhanced"ness of the keyboard in such cases.  "/OK" stands for "original 
  262. keyboard".  This switch may be necessary on some computers to run DESQview 
  263. properly.  This switch keeps DESQview from seeing the function keys F11 and 
  264. F12 though the key is still passed to applications running in windows.  
  265. DESQview will not respond to any of the keyboard calls specific to the 
  266. enhanced keyboard.  This switch is used by appending "ok" to the line invoking 
  267. DESQview, for example:
  268.  
  269.      dv/ok
  270.  
  271. The usual symptom that indicates that you need this switch is the computer 
  272. beeping, then crashing, when you start DESQview.
  273.  
  274. MAINTAIN SEPARATE SHIFT STATES
  275.  
  276.      In the DESQview setup, Advanced Features, Keyboard, there is a setting 
  277. "Maintain separate shift states".  When this is set to "Y", each window has an 
  278. independent set of shift states (CapsLock, NumLock, ScrollLock).  This setting 
  279. has a special synergy with Keyboard Conflict = 4 that causes a separate copy 
  280. of the BIOS Keyboard Buffer to be maintained for windows with this Keyboard 
  281. Conflict setting.  Read the section titled "Keyboard Conflict = 4" for further 
  282. discussion of this feature.
  283.  
  284.      IA
  285.  
  286.      This switch tells QEMM-386 not to trap the manipulation of the ports of 
  287. the 8042 (the common keyboard controller chip).  Programs must do this in 
  288. order to change the state of the A20 address line, which they must do to 
  289. access extended memory.  IA is an abbreviation for "ignorea20".  For some 
  290. programs this may cause unusual keyboard symptoms, usually inappropriate shift 
  291. states (both numlock and capslock) and disabled function keys. These problems 
  292. may go away inside DESQview and only occur outside DESQview.  This switch is 
  293. put on the QEMM-386 line, for example:
  294.  
  295.      device=c:\qemm\QEMM386.sys ram ia 
  296.      device=c:\qemm\qemm.sys ram ia
  297.  
  298. SUMMARY
  299.  
  300.      DESQview must create a separate keyboard environment for each window.  
  301. DESQview handles this keyboard environment properly for almost all programs so 
  302. the default keyboard conflict setting of 0 is best for most windows.  
  303.      If you are having trouble with DESQview scripts or Mark and Transfer, the 
  304. settings 1 or 2 address this problem.  
  305.      If a program is stealing keystrokes when it is in background then setting 
  306. keyboard conflict to 4 addresses this problem.  Setting "Maintain separate 
  307. shift states" to "Y" may be necessary to prevent a program that needs this 
  308. setting of keyboard conflict to keep it from stealing keystrokes when it is in 
  309. a background window.
  310.      DESQview scripts and transfers cannot be executed in a window which has a 
  311. program that takes keystrokes out of the BIOS keyboard buffer without using 
  312. Int 16.
  313.      A program with problems that may not have any obvious relation to the 
  314. keyboard may need keyboard conflict of 8.  Unfortunately there is no obvious 
  315. way for the naive user to know whether the ills from which they are suffering 
  316. will be cured by this setting.  Known target programs that benefit from this 
  317. setting are Lotus 3.1 and some 3270 and 5250 emulation programs.
  318.  
  319.   ************************************************************************
  320.   *This technical note may be copied and distributed freely as long as it*
  321.   *is distributed in its entirety and it is not distributed for profit.  *
  322.   *         Copyright (C) 1990-2 by Quarterdeck Office Systems           *
  323.   ************************ E N D   O F   F I L E *************************
  324.